﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:GalaSoft_MvvmLight_Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4" xmlns:Common="clr-namespace:MVVM_CAD.Common" mc:Ignorable="d"
	x:Class="MVVM_CAD.CanvasView"
	x:Name="UserControl"
	d:DesignWidth="844" d:DesignHeight="656"
    DataContext="{Binding Main, Source={StaticResource Locator}}">

	<Grid x:Name="LayoutRoot">
		<Common:DrawingCanvas x:Name="cnvPrincipalCanvas" Background="White" Loaded="cnvPrincipalCanvas_Loaded">
			<Canvas.Effect>
				<DropShadowEffect BlurRadius="45"/>
			</Canvas.Effect>
			<i:Interaction.Triggers>
				<i:EventTrigger EventName="MouseLeftButtonDown">
					<GalaSoft_MvvmLight_Command:EventToCommand x:Name="OnClic" Command="{Binding OnClicToolCommand, Mode=OneWay}" PassEventArgsToCommand="True"/>
				</i:EventTrigger>
				<i:EventTrigger EventName="MouseLeftButtonUp" SourceName="cnvPrincipalCanvas" SourceObject="{Binding ElementName=cnvPrincipalCanvas}">
					<GalaSoft_MvvmLight_Command:EventToCommand x:Name="OnClicRelease" PassEventArgsToCommand="True" Command="{Binding OnClicToolCommand, Mode=OneWay}"/>
				</i:EventTrigger>
				<i:EventTrigger EventName="MouseMove">
					<GalaSoft_MvvmLight_Command:EventToCommand x:Name="OnMove" Command="{Binding OnMoveToolCommand, Mode=OneWay}" PassEventArgsToCommand="True"/>
				</i:EventTrigger>
			</i:Interaction.Triggers>
        </Common:DrawingCanvas>
	</Grid>
</UserControl>